package com.zhoujian.creational;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 全局计数器
 */
public enum GlobalCount {
    INSTANCE;
    private AtomicLong atomicLong = new AtomicLong(0);

    public Long getNumber(){
        return atomicLong.getAndIncrement();
    }
}
